
$(document).ready(function() {
	var date = new Date();
	//var d = date.getDate();
	//var m = date.getMonth();
	var y = date.getFullYear();
	$("#year_input").val(y);
	$('#cc').combobox({
		url : ctx + '/room/getAllRoom',
		valueField : 'id',
		textField : 'name',
		required : true,
		onSelect : function(param) {
			$("#roomId").val(param.id);
		}
	});
	$('#dt').datetimebox({  
		    value: '3/4/2010 2:3',  
		    required: true,  
		    showSeconds: true  
		}); 
	$('#dt2').datetimebox({  
		value: '3/4/2010 2:3',  
		required: true,  
		showSeconds: true  
	}); 
	$('#roomScheduleAddForm').form({
		url : ctx + '/regularMeeting/addRoomScheduleEvent',
		onSubmit : function() {
			progressLoad();
			var isValid = $(this).form('validate');
			if (!isValid) {
				progressClose();
			}
			return isValid;
		},
		success : function(result) {
			progressClose();
			result = $.parseJSON(result);
			if (result.success) {
				parent.$.messager.alert('正确', result.msg, 'info');
			} else {
				parent.$.messager.alert('错误', result.msg, 'error');
			}
		}
	});
	$('#btn').bind('click', function() {
		$('#roomScheduleAddForm').submit();
	});
	
});
function deleteRegular(){
	$('#roomScheduleAddForm').form('submit', {
		url : ctx + '/regularMeeting/deleteRoomScheduleEvent',
	    onSubmit: function(){
	    	progressLoad();
			var isValid = $(this).form('validate');
			if (!isValid) {
				progressClose();
			}
			return isValid;
	    },
	    success: function(){
	    	progressClose();
			result = $.parseJSON(result);
			if (result.success) {
				parent.$.messager.alert('正确', result.msg, 'info');
			} else {
				parent.$.messager.alert('错误', result.msg, 'error');
			}
	    }
	});
}
